import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
export type DefaultConfig = PowerPartial<EggAppConfig>;

export default (appInfo: EggAppInfo) => {
  const config = {} as DefaultConfig;

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1632802739305_7517';

  // add your config here
  config.middleware = [];

  config.midwayFeature = {
    // true 代表使用 midway logger
    // false 或者为空代表使用 egg-logger
    replaceEggLogger: true,
  };

  // config.security = {
  //   csrf: false,
  // };

  config.mongoose = {
    // uri: 'mongodb+srv://cluster0.hy9wo.mongodb.net/',
    uri: 'mongodb://localhost:27017/egg-mongo',
    options: {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      dbName: 'egg-mongo',
    },
  };

  return config;
};
